package com.cw.mp.mapper;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.cw.mp.domain.po.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;


public interface UserMapper extends BaseMapper<User> {
    void updateByCustom(@Param(Constants.WRAPPER) UpdateWrapper<User> userUpdateWrapper, @Param("amount") int amount);
    //    void updateByCustom(@Param("ew") UpdateWrapper<User> userUpdateWrapper, @Param("amount") int amount);

    @Update("update user set balance = balance - #{money} where id = #{id}")
    void deductionBalance(@Param("id") Long id,@Param("money") Long money);

}
